package org.nf.mvc.view;

import org.nf.mvc.servlet.View;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Author : LLH
 * @create 2021/5/28
 */
public class ForwardView extends View {
    private String url;

    public ForwardView(String url){
        this.url=url;
    }

    /**
     * 转发视图
     * @throws ServletException
     * @throws IOException
     */
    @Override
    protected void response() throws ServletException, IOException {
        request.getRequestDispatcher(url).forward(request,response);
    }
}
